var status = -1;
var selectionLog = [];

function action(e, d, c) {
    if (status == 0 && e == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = c;
    var b = -1;
    if (status <= b++) {
        cm.dispose()
    } else {
        if (status === b++) {
            var a = cm.rand(9400053, 9400056);
            cm.npc_ChangeController(a, 6, 46);
            cm.fieldEffect_复合图片动画(["Map/EffectPL.img/3min/notice_spine/bg/skeleton_text_bg", "animation_text01_01", "", ""], [0, 0, 1, 0, 0, 0, 0, 0]);
            cm.fieldEffect_复合图片动画(["Map/EffectPL.img/3min/notice_spine/stage/skeleton_text_02", "animation_text02_09", "", ""], [0, 0, 1, 0, 0, 0, 0, 0]);
            cm.effect_Voice("PL_3min.img/effectSound/stageUI", 100);
            cm.setNumberForQuestInfo(59785, "867110500", 1);
            cm.setNumberForQuestInfo(59785, a, 1);
            checkShop();
            checkStage();
            cm.dispose()
        } else {
            cm.dispose()
        }
    }
}

function checkShop() {
    for (var a = 9400053; a <= 9400056; a++) {
        if (!cm.getInfoQuest(59785).contains("" + a)) {
            return
        }
    }
    cm.setNumberForQuestInfo(59785, "shop", 1)
}

function checkStage() {
    for (var a = 867110050; a <= 867110700; a += 50) {
        if (!cm.getInfoQuest(59785).contains("" + a)) {
            return
        }
    }
    cm.setNumberForQuestInfo(59785, "stage", 1)
}

function start() {
    status = -1;
    action(1, 0, 0)
};